#include "loger.h"
#include "loger_inner.h"

/* loger format 日志格式定义 */


/* define */

/**
 * CSI(Control Sequence Introducer/Initiator) sign
 * more information on https://en.wikipedia.org/wiki/ANSI_escape_code
 */
/* 文字颜色 */
#define LOG_COLOR_TXT_BLACK     "30m"
#define LOG_COLOR_TXT_RED       "31m"
#define LOG_COLOR_TXT_GREEN     "32m"
#define LOG_COLOR_TXT_YELLOW    "33m"
#define LOG_COLOR_TXT_BLUE      "34m"
#define LOG_COLOR_TXT_MAGENTA   "35m"
#define LOG_COLOR_TXT_CYAN      "36m"
#define LOG_COLOR_TXT_WHITE     "37m"

/* 背景颜色 */
#define LOG_COLOR_BK_BLACK      "40;"
#define LOG_COLOR_BK_RED        "41;"
#define LOG_COLOR_BK_GREEN      "42;"
#define LOG_COLOR_BK_YELLOW     "43;"
#define LOG_COLOR_BK_BLUE       "44;"
#define LOG_COLOR_BK_MAGENTA    "45;"
#define LOG_COLOR_BK_CYAN       "46;"
#define LOG_COLOR_BK_WHITE      "47;"


/* export var */


const _loger_fmt_info_t loger_fmt_info_t[] = 
{
    [LOG_LV_ASSERT] = { .head="[A]", .color_txt=LOG_COLOR_TXT_MAGENTA, .color_bk=NULL },
    [LOG_LV_ERROR] = { .head="[E]", .color_txt=LOG_COLOR_TXT_RED, .color_bk=NULL },
    [LOG_LV_WARN] = { .head="[W]", .color_txt=LOG_COLOR_TXT_YELLOW, .color_bk=NULL },
    [LOG_LV_INFO] = { .head="[I]", .color_txt=LOG_COLOR_TXT_GREEN, .color_bk=NULL },
    [LOG_LV_DEBUG] = { .head="[D]", .color_txt=LOG_COLOR_TXT_BLUE, .color_bk=NULL },
    [LOG_LV_VERBOSE] = { .head=NULL, .color_txt=NULL, .color_bk=NULL },
};




